最佳实践@ 内容 概述 插件拓展问题 包找不到 插件管理 核心代码 客户化代码 debug 概述 插件拓展问题 https://sourceforge.net/p/adempiere/discussion/610548/thread/6767780f/ 插件拓展问题 http://wiki.adempiere.net/Extensions_Friendly_Proposal https://sourceforge.net/p/adempiere/discussion/610548/thread/bf61f67e/ 包找不到 idempiere的最新源码的包依赖可能与一些老插件不一样。 或者你在某个版本,你想到另外一个版本去开发,你参考下面的链接:(仔细读) http://wiki.idempiere.org/en/Update_your_development_environment_zk7_branch https://idempiere.atlassian.net/browse/IDEMPIERE-2969 (每次基础库升级,都要注意补丁) 插件管理 http://wiki.idempiere.org/en/Developing_plug-ins_without_affecting_the_trunk 核心代码 register your own model factory For example, if you have "com.abc.model.MRequisition" for "M_Requisition", `public Class<?> getClass (String tableName) { if ("M_Requisition".equals(tableName)) { return com.abc.model.MRequisition.class; } else { return null; } } public PO getPO (String tableName, int Record_ID, String trxName) { if ("M_Requisition".equals(tableName)) { return new com.abc.model.MRequisition(Env.getCtx(), Record_ID, trxName); } else { return null; } }` https://groups.google.com/d/msg/idempiere/SDKbP_tjdWc/SyAqQWBKJgQJ do not use extension points but OSGi Services https://groups.google.com/d/msg/idempiere/AwxQ_TQJpzo/DF0DOMZ5sdEJ It is not hard to run iDempiere in the Eclipse debugger. Then you can set a breakpoint on Core.getProcess() and see what happens. More often than I like I have the problem that a plugin is not activated really in the production environment. It can be not loaded, not activated or in a "lazy" state. If I suspect this issue I start iDempiere with an osgi console and use the "ss" command. Using the felix web console should also work. btw: **I do not use extension points but OSGi Services** for Processes and other Plugin things. AFAIR there is a recommendation from Heng Sin to use Services for future plugins and he deprecated the extensions interface. Please ask him if you need to be sure about this point. (Said that: I am sure this has nothing to do with your problems.) 客户化代码 http://docs.metasfresh.org/developers_collection/en/de.metas.endcustomer.mf15.html In de.metas.endcustomer.mf15 we take all the metasfresh projects and their artifacts and construct the distributables. Also see [developer_doc_getting_started] in order to better understand this process. Note that mf15 is our internal “customer code” for the “metasfresh” project. For other customers or clients, we might have dedicated de.metas.endcustomer.ab12 repositories. However, note that we put as little into any de.metas.endcustomer.ab12 project as we can, in order to avoid duplication and enable external contribution. Usually, what goes into such an endcustomer project is mostly dedicated .properties files which we use as custom resource bundles in our jasper reports, and also some jasper reports, like dedicated shipping documents that only make sense for the respective customer or client. debug First you need to know the table name. Generally in any window in iDempiere you can click the record info to know the table name of that tab (see image) After you know the table name, you can find the java model class name by removing the prefix and adding "M" in the front. So C_OrderLine become MOrderLine, M_InOut become MInOut, C_BPartner become MBPartner, etc. You can find the class in eclipse using shortcut Ctrl+Shift+T. You can check method beforeSave and afterSave of that model class if you want to know what the system doing when user insert a record (note the newRecord flag). Also you can check class PO (Persistent Object) to study more about how system save the data to database. But if you want to do customization you don't want to change the model class directly. For that customization you can use Model Validator. You can study more about Model Validator in the references below. http://wiki.idempiere.org/en/Developing_Plug-Ins_-_ModelValidator https://www.youtube.com/watch?v=Dwjl8p1Xguw